<?php

// +----------------------------------------------------------------------
// |
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2030 http://www.jmzh1688.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: lxl
// +----------------------------------------------------------------------


namespace app\admin\controller;

use think\Controller;
use think\Db;

use app\admin\model\SysconfigModel;


class Sysconfig extends Base
{
    public $name='';

        
    function __construct() {
        parent::__construct();
     
      
    }


    public function loadconfig()
    {
        $name= input("get.name");
        $configmodel = new SysconfigModel();
        $config_info = $configmodel->getByName($name);
        return json_decode($config_info['value'],true);
    }

    public function saveconfig()
    {
        $name= input("get.name");
        $configmodel = new SysconfigModel();
        $param = input("post.");
        $value = json_encode($param);
        $params = ['name' => $name, 'value' => $value];

        $flag = $configmodel->insertConfig($params);
        return json_encode($flag);
    }


    public function index()
    {
        $name= 'base';
        $this->assign([
            'name' => $name
        ]);
        return $this->fetch();
    }


 


    public function upload()
    {
        $name= 'upload';
        $this->assign([
            'name' => $name
        ]);
        return $this->fetch();
    }

    public function base()
    {
        $name= 'base';
        $this->assign([
            'name' => $name
        ]);
        return $this->fetch();
    }



    
    public function wx()
    {
        $name= 'wx';
        $this->assign([
            'name' => $name
        ]);
        return $this->fetch();
    }





}
